home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Networking / OTLLCTest / NegotiateRawModeSample.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  2.4 KB  |  113 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        NegotiateRawModeSample.h
  3.  
  4.     Contains:    
  5.  
  6.     Written by: rich kubota    
  7.  
  8.     Copyright:    Copyright © 1997-1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 7/22/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 
  21.  
  22. */
  23.  
  24. #ifndef __NEGOTIATERAWMODESAMPLE__
  25. #define __NEGOTIATERAWMODESAMPLE__
  26.  
  27. #include <Types.h>
  28. #include "OpenTransport.h"
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34. #if PRAGMA_ALIGN_SUPPORTED
  35. #pragma options align=mac68k
  36. #endif
  37.  
  38. #if PRAGMA_IMPORT_SUPPORTED
  39. #pragma import on
  40. #endif
  41.  
  42. enum
  43. {
  44.     kOTVers12    = 0x01208000
  45. };
  46.  
  47. enum
  48. {
  49.     kUnknownTemplate     = 0x00,
  50.     kOrigTemplate,
  51.     kMentatTemplate
  52. };
  53.  
  54. /* Flags for various structures. */
  55.  
  56. enum
  57. {
  58.     DL_NORMAL_STATUS    = 0x01,
  59.     DL_ERROR_STATUS        = 0x02,
  60.     DL_TRUNCATED_PACKET    = 0x04,
  61.     DL_VERSION            = 0x00,
  62.     DL_VERSION_BITS        = 0xF0000000
  63. };
  64.  
  65. /*
  66.  * Receive and send error flags, these should not overlap with other
  67.  * flags above.
  68.  */
  69. enum
  70. {
  71.     DL_CRC_ERROR        = 0x10,
  72.     DL_RUNT_ERROR        = 0x20,
  73.     DL_FRAMING_ERROR    = 0x40,
  74.     DL_BAD_802_3_LENGTH    = 0x80,
  75.     DL_ERROR_MASK        = DL_CRC_ERROR | DL_RUNT_ERROR | DL_FRAMING_ERROR | DL_BAD_802_3_LENGTH
  76. };
  77.  
  78. /* Input and output structure for I_OTSetRawMode kOTSetRecvMode ioctl. */
  79. struct dl_recv_control_t {
  80.     unsigned long    dl_primitive;
  81.     unsigned long    dl_flags;
  82.     unsigned long    dl_truncation_length;
  83. };
  84.  
  85. typedef struct dl_recv_control_t dl_recv_control_t;
  86.  
  87.  
  88. struct dl_recv_status_t {
  89. unsigned long    dl_overall_length;
  90. unsigned long    dl_flags;
  91. unsigned long    dl_packet_length_before_truncation;
  92. unsigned long    dl_pad;
  93. OTTimeStamp        dl_timestamp;
  94. };
  95.  
  96. typedef struct dl_recv_status_t dl_recv_status_t;
  97.  
  98. extern pascal OSStatus DoNegotiateRawModeOption(EndpointRef ep, 
  99.                                                 UInt32 rawModeOption,
  100.                                                 UInt32 *templateType);
  101.  
  102. #if PRAGMA_ALIGN_SUPPORTED
  103. #pragma options align=reset
  104. #endif
  105. #if PRAGMA_IMPORT_SUPPORTED
  106. #pragma import off
  107. #endif
  108.  
  109. #ifdef __cplusplus
  110. }
  111. #endif
  112.  
  113. #endif    // __NEGOTIATERAWMODESAMPLE__